home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / doc / devtools.doc < prev    next >
Text File  |  1994-10-15  |  21KB  |  513 lines

  1. TABLE OF CONTENTS
  2.  
  3. devtools.doc/cpp
  4. devtools.doc/rpcgen
  5. utilities/rcsrev
  6. devtools.doc/cpp                                             devtools.doc/cpp
  7.  
  8.    NAME
  9.        cpp - C Pre-Processor
  10.  
  11.    SYNOPSIS
  12.        cpp [-options] [infile [outfile]]
  13.  
  14.    DESCRIPTION
  15.        CPP reads a C source file, expands macros and include files, and
  16.        writes an input file for the C compiler.  If no file arguments are
  17.        given, CPP reads from stdin and writes to stdout.  If one file
  18.        argument is given, it will define the input file, while two file
  19.        arguments define both input and output files.  The file name "-" is
  20.        a synonym for stdin or stdout as appropriate.
  21.  
  22.        The following options are supported.  Options may be given in either
  23.        case.
  24.  
  25.        -C             If set, source-file comments are written to the
  26.                       output file.  This allows the output of CPP to be
  27.                       used as the input to a program, such as lint, that
  28.                       expects commands embedded in specially-formatted
  29.                       comments.
  30.  
  31.        -Dname=value   Define the name as if the programmer wrote
  32.  
  33.                           #define name value
  34.  
  35.                       at the start of the first file.  If "=value" is not
  36.                       given, a value of "1" will be used.
  37.  
  38.                       On non-unix systems, all alphabetic text will be
  39.                       forced to upper-case.
  40.  
  41.        -E             Always return "success" to the operating system, even
  42.                       if errors were detected.  Note that some fatal
  43.                       errors, such as a missing #include file, will
  44.                       terminate CPP, returning "failure" even if the -E
  45.                       option is given.
  46.  
  47.        -Idirectory    Add this directory to the list of directories
  48.                       searched for #include "..."  and #include <...>
  49.                       commands.  Note that there is no space between the
  50.                       "-I" and the directory string.  More than one -I
  51.                       command is permitted.  On non-Unix systems
  52.                       "directory" is forced to upper-case.
  53.  
  54.        -N             CPP normally predefines some symbols defining the
  55.                       target computer and operating system.  If -N is
  56.                       specified, no symbols will be predefined.  If -N -N
  57.                       is specified, the "always present" symbols, __LINE__,
  58.                       __FILE__, and __DATE__ are not defined.
  59.  
  60.        -P             Do not output #line directives.
  61.  
  62.        -Stext         CPP normally assumes that the size of the target
  63.                       computer's basic variable types is the same as the
  64.                       size of these types of the host computer.  (This can
  65.                       be overridden when CPP is compiled, however.)  The -S
  66.                       option allows dynamic respecification of these
  67.                       values.  "text" is a string of numbers, separated by
  68.                       commas, that specifies correct sizes.  The sizes must
  69.                       be specified in the exact order:
  70.  
  71.                           char short int long float double
  72.  
  73.                       If you specify the option as "-S*text", pointers to
  74.                       these types will be specified.  -S* takes one
  75.                       additional argument for pointer to function (e.g.
  76.                       int (*)())
  77.  
  78.                       For example, to specify sizes appropriate for a
  79.                       PDP-11, you would write:
  80.  
  81.                              c s i l f d func
  82.                            -S1,2,2,2,4,8,
  83.                           -S*2,2,2,2,2,2,2
  84.  
  85.                       Note that all values must be specified.
  86.  
  87.        -Uname         Undefine the name as if
  88.  
  89.                           #undef name
  90.  
  91.                       were given.  On non-Unix systems, "name" will be
  92.                       forced to upper-case.
  93.  
  94.        -Xnumber       Enable debugging code.  If no value is given, a value
  95.                       of 1 will be used.  (For maintenence of CPP only.)
  96.  
  97.  
  98.    PRE-DEFINED VARIABLES 
  99.        When CPP begins processing, the following variables will have been
  100.        defined (unless the -N option is specified):
  101.  
  102.        Target computer (as appropriate):
  103.  
  104.            pdp11, vax, M68000 m68000 m68k
  105.  
  106.        Target operating system (as appropriate):
  107.  
  108.            rsx, rt11, vms, unix
  109.  
  110.        Target compiler (as appropriate):
  111.  
  112.            decus, vax11c
  113.  
  114.        The implementor may add definitions to this list.  The default
  115.        definitions match the definition of the host computer, operating
  116.        system, and C compiler.
  117.  
  118.        The following are always available unless undefined (or -N was
  119.        specified twice):
  120.  
  121.            __FILE__    The input (or #include) file being compiled (as a
  122.                        quoted string).
  123.  
  124.            __LINE__    The line number being compiled.
  125.  
  126.            __DATE__    The date and time of compilation as a Unix ctime
  127.                        quoted string (the trailing newline is removed).
  128.                        Thus,
  129.  
  130.                            printf("Bug at line %s,", __LINE__);
  131.                            printf(" source file %s", __FILE__);
  132.                            printf(" compiled on %s", __DATE__);
  133.  
  134.  
  135.    DRAFT PROPOSED ANSI STANDARD CONSIDERATIONS
  136.        The current version of the Draft Proposed Standard explicitly states
  137.        that "readers are requested not to specify or claim conformance to
  138.        this draft." Readers and users of Decus CPP should not assume that
  139.        Decus CPP conforms to the standard, or that it will conform to the
  140.        actual C Language Standard.
  141.  
  142.        When CPP is itself compiled, many features of the Draft Proposed
  143.        Standard that are incompatible with existing preprocessors may be
  144.        disabled.  See the comments in CPP's source for details.
  145.  
  146.        The latest version of the Draft Proposed Standard (as reflected in
  147.        Decus CPP) is dated November 12, 1984.
  148.  
  149.        Comments are removed from the input text.  The comment is replaced
  150.        by a single space character.  The -C option preserves comments,
  151.        writing them to the output file.
  152.  
  153.        The '$' character is considered to be a letter.  This is a permitted
  154.        extension.
  155.  
  156.        The following new features of C are processed by CPP:
  157.  
  158.            #elif expression (#else #if)
  159.            '\xNNN' (Hexadecimal constant)
  160.            '\a' (Ascii BELL)
  161.            '\v' (Ascii Vertical Tab)
  162.            #if defined NAME 1 if defined, 0 if not
  163.            #if defined (NAME) 1 if defined, 0 if not
  164.            #if sizeof (basic type)
  165.            unary +
  166.            123U, 123LU Unsigned ints and longs.
  167.            12.3L Long double numbers
  168.            token#token Token concatenation
  169.            #include token Expands to filename
  170.  
  171.        The Draft Proposed Standard has extended C, adding a constant string
  172.        concatenation operator, where
  173.  
  174.            "foo" "bar"
  175.  
  176.        is regarded as the single string "foobar".  (This does not affect
  177.        CPP's processing but does permit a limited form of macro argument
  178.        substitution into strings as will be discussed.)
  179.  
  180.        The Standard Committee plans to add token concatenation to #define
  181.        command lines.  One suggested implementation is as follows: the
  182.        sequence "Token1#Token2" is treated as if the programmer wrote
  183.        "Token1Token2".  This could be used as follows:
  184.  
  185.            #line 123
  186.            #define ATLINE foo#__LINE__
  187.  
  188.        ATLINE would be defined as foo123.
  189.  
  190.        Note that "Token2" must either have the format of an identifier or
  191.        be a string of digits.  Thus, the string
  192.  
  193.            #define ATLINE foo#1x3
  194.  
  195.        generates two tokens:  "foo1" and "x3".
  196.  
  197.        If the tokens T1 and T2 are concatenated into T3, this
  198.        implementation operates as follows:
  199.  
  200.          1. Expand T1 if it is a macro.
  201.          2. Expand T2 if it is a macro.
  202.          3. Join the tokens, forming T3.
  203.          4. Expand T3 if it is a macro.
  204.  
  205.        A macro formal parameter will be substituted into a string or
  206.        character constant if it is the only component of that constant:
  207.  
  208.            #define VECSIZE 123
  209.            #define vprint(name, size) \
  210.              printf("name" "[" "size" "] = {\n")
  211.              ... vprint(vector, VECSIZE);
  212.  
  213.        expands (effectively) to
  214.  
  215.              vprint("vector[123] = {\n");
  216.  
  217.        Note that this will be useful if your C compiler supports the new
  218.        string concatenation operation noted above.  As implemented here, if
  219.        you write
  220.  
  221.            #define string(arg) "arg"
  222.              ... string("foo") ...
  223.  
  224.        This implementation generates "foo", rather than the strictly
  225.        correct ""foo"" (which will probably generate an error message).
  226.        This is, strictly speaking, an error in CPP and may be removed from
  227.        future releases.
  228.  
  229.    ERROR MESSAGES
  230.        Many.  CPP prints warning or error messages if you try to use
  231.        multiple-byte character constants (non-transportable) if you #undef
  232.        a symbol that was not defined, or if your program has potentially
  233.        nested comments.
  234.  
  235.    AUTHOR
  236.        Martin Minow
  237.  
  238.    BUGS
  239.        The #if expression processor uses signed integers only.  I.e,
  240.        #if 0xFFFFu < 0 may be TRUE.
  241.  
  242. devtools.doc/rpcgen                                       devtools.doc/rpcgen
  243.  
  244.    NAME
  245.        rpcgen - an RPC protocol compiler
  246.  
  247.    SYNOPSIS
  248.        rpcgen infile
  249.        rpcgen [-Dname[=value]] [-T] [-K secs] infile
  250.        rpcgen -c|-h|-l|-m|-t [-o outfile ] infile
  251.        rpcgen [-I] -s nettype [-o outfile] infile
  252.        rpcgen -n netid [-o outfile] infile
  253.  
  254.    DESCRIPTION
  255.        rpcgen is a tool that generates C code to implement an RPC protocol.
  256.        The input to rpcgen is a language similar to C known as RPC Language
  257.        (Remote Procedure Call Language).
  258.  
  259.        rpcgen is normally used as in the first synopsis where it takes an
  260.        input file and generates up to four output files.  If the infile is
  261.        named proto.x, then rpcgen will generate a header file in proto.h,
  262.        XDR routines in proto_xdr.c, server-side stubs in proto_svc.c, and
  263.        client-side stubs in proto_clnt.c.  With the -T option, it will also
  264.        generate the RPC dispatch table in proto_tbl.i.  With the -Sc
  265.        option, it will also generate sample code which would illustrate how
  266.        to use the remote procedures on the client side. This code would be
  267.        created in proto_client.c.  With the -Ss option, it will also
  268.        generate a sample server code which would illustrate how to write
  269.        the remote procedures. This code would be created in proto_server.c.
  270.  
  271.        The server created can be started both by the port monitors (for
  272.        example, inetd or listen) or by itself.  When it is started by a
  273.        port monitor, it creates servers only for the transport for which
  274.        the file descriptor 0 was passed.  The name of the transport must be
  275.        specified by setting up the environmental variable PM_TRANSPORT.
  276.        When the server generated by rpcgen is executed, it creates server
  277.        handles for all the transports specified in NETPATH environment
  278.        variable, or if it is unset, it creates server handles for all the
  279.        visible transports from /etc/netconfig file.  Note: the transports
  280.        are chosen at run time and not at compile time.  When the server is
  281.        self-started, it backgrounds itself by default.  A special define
  282.        symbol RPC_SVC_FG can be used to run the server process in
  283.        foreground.
  284.  
  285.        The second synopsis provides special features which allow for the
  286.        creation of more sophisticated RPC servers.  These features include
  287.        support for user provided #defines and RPC dispatch tables.  The
  288.        entries in the RPC dispatch table contain:
  289.           +  pointers to the service routine corresponding to that
  290.              procedure,
  291.           +  a pointer to the input and output arguments
  292.           +  the size of these routines
  293.        A server can use the dispatch table to check authorization and then
  294.        to execute the service routine; a client library may use it to deal
  295.        with the details of storage management and XDR data conversion.
  296.  
  297.        The other three synopses shown above are used when one does not want
  298.        to generate all the output files, but only a particular one.  Some
  299.        examples of their usage is described in the EXAMPLE section below.
  300.        When rpcgen is executed with the -s option, it creates servers for
  301.        that particular class of transports.  When executed with the -n
  302.        option, it creates a server for the transport specified by netid.
  303.        If infile is not specified, rpcgen accepts the standard input.
  304.  
  305.        The C preprocessor, ccp, is run on the input file before it is
  306.        actually interpreted by rpcgen.  For each type of output file,
  307.        rpcgen defines a special preprocessor symbol for use by the rpcgen
  308.        programmer:
  309.  
  310.        RPC_HDR   defined when compiling into header files
  311.        RPC_XDR   defined when compiling into XDR routines
  312.        RPC_SVC   defined when compiling into server-side stubs
  313.        RPC_CLNT  defined when compiling into client-side stubs
  314.        RPC_TBL   defined when compiling into RPC dispatch tables
  315.  
  316.        Any line beginning with `%' is passed directly into the output file,
  317.        uninterpreted by rpcgen.
  318.  
  319.        For every data type referred to in infile, rpcgen assumes that there
  320.        exists a routine with the string xdr_ prepended to the name of the
  321.        data type.  If this routine does not exist in the RPC/XDR library,
  322.        it must be provided.  Providing an undefined data type allows
  323.        customization of XDR routines.
  324.  
  325.        The following options are available:
  326.  
  327.        -a   Generate all the files including sample code for client and
  328.             server side.
  329.  
  330.        -b   This generates code for the SunOS4.1 style of rpc. It is for
  331.             backward compatibilty.  This is the default.
  332.  
  333.        -5   This generates code for the SysVr4 style of rpc. It is used by
  334.             the Transport Independent RPC that is in Svr4 systems.  By
  335.             default rpcgen generates code for SunOS4.1 stype of rpc.
  336.  
  337.        -c   Compile into XDR routines.
  338.  
  339.        -C   Generate code in ANSI C. This option also generates code that
  340.             could be compiled with the C++ compiler.  This is the default.
  341.  
  342.        -k   Generate code in K&R C.  The default is ANSI C.
  343.  
  344.        -Dname[=value]
  345.             Define a symbol name.  Equivalent to the #define directive in the
  346.             source.  If no value is given, value is defined as 1.  This
  347.             option may be specified more than once.
  348.  
  349.        -h   Compile into C data-definitions (a header file).  -T option can
  350.             be used in conjunction to produce a header file which supports
  351.             RPC dispatch tables.
  352.  
  353.        -I  Generate a service that can be started from inetd.  The default
  354.             is to generate a static service that handles transports
  355.             selected with -s.  Using -I allows starting a service by either
  356.             method.
  357.  
  358.        -K secs
  359.             By default, services created using rpcgen wait 120 seconds
  360.             after servicing a request before exiting.  That interval can be
  361.             changed using the -K flag.  To create a server that exits
  362.             immediately upon servicing a request, -K 0 can be used.  To
  363.             create a server that never exits, the appropriate argument is
  364.             -K -1.
  365.  
  366.             When monitoring for a server, some portmonitors, like
  367.             listen(1M), always spawn a new process in response to a service
  368.             request.  If it is known that a server will be used with such a
  369.             monitor, the server should exit immediately on completion.  For
  370.             such servers, rpcgen should be used with -K -1.
  371.  
  372.        -l   Compile into client-side stubs.
  373.  
  374.        -m   Compile into server-side stubs, but do not generate a main
  375.             routine.  This option is useful for doing callback-routines and
  376.             for users who need to write their own main routine to do
  377.             initialization.
  378.  
  379.        -n netid
  380.             Compile into server-side stubs for the transport specified by
  381.             netid.  There should be an entry for netid in the netconfig
  382.             database.  This option may be specified more than once, so as
  383.             to compile a server that serves multiple transports.
  384.  
  385.        -N   Use the newstyle of rpcgen. This allows procedures to have
  386.             multiple arguments. It also uses the style of parameter passing
  387.             that closely resembles C. So, when passing an argument to a
  388.             remote procedure you do not have to pass a pointer to the
  389.             argument but the argument itself. This behaviour is different
  390.             from the oldstyle of rpcgen generated code. The newstyle is not
  391.             the default case because of backward compatibility.
  392.  
  393.        -o outfile
  394.             Specify the name of the output file.  If none is specified,
  395.             standard output is used (-c, -h, -l, -m, -n, -s, -sSc, -sSs and
  396.             -t modes only).
  397.  
  398.        -s nettype
  399.             Compile into server-side stubs for all the transports belonging
  400.             to the class nettype.  The supported classes are netpath,
  401.             visible, circuit_n, circuit_v, datagram_n, datagram_v, tcp, and
  402.             udp [see rpc(3N) for the meanings associated with these
  403.             classes].  This option may be specified more than once.  Note:
  404.             the transports are chosen at run time and not at compile time.
  405.  
  406.        -Sc  Generate sample code to show the use of remote procedure and
  407.             how to bind to the server before calling the client side stubs
  408.             generated by rpcgen.
  409.  
  410.        -Ss  Generate skeleton code for the remote procedures on the server
  411.             side. You would need to fill in the actual code for the remote
  412.             procedures.
  413.  
  414.        -t   Compile into RPC dispatch table.
  415.  
  416.        -T   Generate the code to support RPC dispatch tables.
  417.  
  418.        The options -c, -h, -l, -m, -s and -t are used exclusively to generate
  419.        a particular type of file, while the options -D and -T are global and
  420.        can be used with the other options.
  421.  
  422.    NOTES
  423.        The RPC Language does not support nesting of structures.  As a work-
  424.        around, structures can be declared at the top-level, and their name
  425.        used inside other structures in order to achieve the same effect.
  426.  
  427.        Name clashes can occur when using program definitions, since the
  428.        apparent scoping does not really apply.  Most of these can be
  429.        avoided by giving unique names for programs, versions, procedures
  430.        and types.
  431.  
  432.        The server code generated with -n option refers to the transport
  433.        indicated by netid and hence is very site specific.
  434.  
  435.    EXAMPLE
  436.        The following example:
  437.  
  438.           $ rpcgen -T prot.x
  439.  
  440.        generates the five files: prot.h, prot_clnt.c, prot_svc.c,
  441.        prot_xdr.c and prot_tbl.i.
  442.  
  443.        The following example sends the C data-definitions (header file) to
  444.        the standard output.
  445.  
  446.           $ rpcgen -h prot.x
  447.  
  448.        To send the test version of the -DTEST, server side stubs for all
  449.        the transport belonging to the class datagram_n to standard output,
  450.        use:
  451.  
  452.           $ rpcgen -s datagram_n -DTEST prot.x
  453.  
  454.        To create the server side stubs for the transport indicated by netid
  455.        tcp, use:
  456.  
  457.           $ rpcgen -n tcp -o prot_svc.c prot.x
  458.  
  459.    SEE ALSO
  460.        devtools.doc/cpp
  461.  
  462. utilities/rcsrev                                             utilities/rcsrev
  463.  
  464.    NAME  
  465.        RCSRev - Convert a RCS ID into #?_rev.? Files
  466.  
  467.    VERSION
  468.        $Id: rcsrev.c,v 4.1 1994/09/30 00:50:36 jraja Exp $      
  469.  
  470.    TEMPLATE       
  471.        RCSREV NAME/A SOURCE/A POSTFIX ASM=ASMINCLUDE/S DATE/K
  472.  
  473.    FUNCTION
  474.        RCSRev is intended to generate a BumbRev-compatible revision
  475.        include files from RCS ID. 
  476.  
  477.        The arguments are used as follows:
  478.  
  479.        NAME/A       - name for program (generate file NAME_rev.h).
  480.        SOURCE/A     - source file name
  481.        PREFIX/K     - optional prefix to program name (eg. AmiTCP/IP_)
  482.        POSTFIX/K    - optional string postfixed to revision string
  483.        ASMINCLUDE/S - create also an assembler include file (generate file
  484.                       NAME_rev.i).
  485.  
  486.        DATE/K       - specify the date format used.  The date formats
  487.                       available are as follows:
  488.            CURRENT   - use current date (default) 
  489.            RCS       - use date from RCS ID
  490.            SASC      - use preprocessor macro __AMIGADATE__
  491.            DICE      - use preprocessor macro __COMMODORE_DATE__
  492.  
  493.    NOTES
  494.        The macro DATE is not defined in the revision file with SASC or
  495.        COMMODORE date formats.  The macro VSTRING is not defined in
  496.        revision file with the SASC format.  (See sources and macro
  497.        FIXED_AMIGADATE).
  498.  
  499.        The SASC or DICE formats can not be used with the ASMINCLUDE option.
  500.  
  501.    BUGS
  502.        RCSRev doesn't recognize other RCS ident string except Id.
  503.  
  504.        Maximum allowed line length is fixed.
  505.  
  506.    AUTHOR
  507.        ppessi <Pekka.Pessi@hut.fi>
  508.  
  509.    COPYRIGHT 
  510.        Copyright © 1994 AmiTCP/IP Group,
  511.        Network Solutions Development Inc., Finland.
  512.  
  513.